<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"  
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core">
    <h:head>
        <title>Search</title>
    </h:head>
    <h:body>
        <h:form id="searchForm" >  
            <h:panelGrid columns="2" cellpadding="5" width="600">
                    <h:outputLabel value="Keyword: " for="autoComplete" />  
                    <p:autoComplete  id="autoComplete" value="#{searchBean.keyword}" completeMethod="#{searchBean.complete()}" maxResults="20" scrollHeight="200">  
                        <p:ajax event="itemSelect" listener="#{searchBean.handleSelect}" update="messages" />  
                    </p:autoComplete>  
                <p:commandButton value="Submit" update="display" oncomplete="dialog.show()" />  
            </h:panelGrid>
            <p:dialog header="Values" widgetVar="dialog"  
                      showEffect="bounce" hideEffect="fold" width="600">  
                <h:panelGrid id="display" columns="2" cellpadding="5">  
                    <h:outputText value="Result: " />  
                    <h:outputText value="#{searchBean.keyword}" />   
                </h:panelGrid>  
            </p:dialog>  
        </h:form> 
    </h:body>
</html>

